home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gs261src.zip / CCFONT.H < prev    next >
Text File  |  1993-05-13  |  3KB  |  64 lines

  1. /* Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* ccfont.h */
  20. /* Header for fonts compiled into C. */
  21.  
  22. /* Define type-specific refs for initializing arrays. */
  23. #define ref_(t) struct { struct tas_s tas; t value; }
  24. #define boolean_v(b) { {t_boolean<<r_type_shift}, (ushort)(b) }
  25. #define integer_v(i) { {t_integer<<r_type_shift}, (long)(i) }
  26. #define null_v() { {t_null<<r_type_shift} }
  27. #define real_v(v) { {t_real<<r_type_shift}, (float)(v) }
  28.  
  29. /* Define other initialization structures. */
  30. typedef struct { byte encx, charx; } charindex;
  31. /* Arrays of strings/names/nulls are represented by byte strings, */
  32. /* containing two bytes of big-endian string length (255,255=null) */
  33. /* followed by the string characters. */
  34. typedef const char *cfont_string_array;
  35.  
  36. /* Support routines in iccfont.c */
  37. typedef struct {
  38.     const charindex *enc_keys;    /* keys from encoding vectors */
  39.     uint num_enc_keys;
  40.     uint num_str_keys;
  41.     uint extra_slots;        /* (need 1 extra for fonts) */
  42.     uint dict_attrs;        /* protection for dictionary */
  43.     uint value_attrs;        /* protection for values */
  44.                     /* (only used for string dicts) */
  45. } cfont_dict_keys;
  46. /* We pass a procedure vector to the font initialization routine */
  47. /* to avoid having externs, which compromise sharability. */
  48. /* On MS-DOS, each compiled font has its own data segment, */
  49. /* so all of these procedures must be declared 'huge' for Borland C. */
  50. typedef struct cfont_procs_s {
  51.     int huge (*ref_dict_create)(P4(ref *, const cfont_dict_keys *,
  52.                        cfont_string_array, const ref *));
  53.     int huge (*string_dict_create)(P4(ref *, const cfont_dict_keys *,
  54.                       cfont_string_array,
  55.                       cfont_string_array));
  56.     int huge (*num_dict_create)(P4(ref *, const cfont_dict_keys *,
  57.                        cfont_string_array, const float *));
  58.     int huge (*name_array_create)(P3(ref *, cfont_string_array, int));
  59.     int huge (*string_array_create)(P4(ref *, cfont_string_array,
  60.                        int /*size*/,
  61.                        uint /*protection*/));
  62.     int huge (*name_create)(P2(ref *, const char *));
  63. } cfont_procs;
  64.